package com.otitan.la.forest.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 组织机构表
 *
 * @author jiacs
 * @email xxx
 * @date 2020-09-15 10:34:19
 */
@Data
@TableName("\"SYS_ORGANIZATION\"")
@ApiModel("组织机构表实体")
public class OrganizationEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
    * 主键
    */
    @ApiModelProperty(value = "主键", required = true)
    @TableId("\"ID\"")
    private String id;

    /**
     * 地区编码
     */
    @ApiModelProperty(value = "地区编码", required = true)
    @NotEmpty(message = "地区编码不能为空")
    @Length(max = 36, message = "地区编码不能超过 36 个字符")
    @TableField("\"AREA_CODE\"")
    private String areaCode;
    /**
    * 编号
    */
    @ApiModelProperty(value = "编号", required = true)
     @NotEmpty(message = "编号不能为空")
     @Length(max = 36, message = "编号不能超过 36 个字符")
    @TableField("\"CODE\"")
    private String code;

    /**
    * 名称
    */
    @ApiModelProperty(value = "名称", required = true)
     @NotEmpty(message = "名称不能为空")
     @Length(max = 20, message = "名称不能超过 20 个字符")
    @TableField("\"NAME\"")
    private String name;

    /**
    * 上级组织
    */
    @ApiModelProperty(value = "上级组织", required = true)
     @NotEmpty(message = "上级组织不能为空")
     @Length(max = 36, message = "上级组织不能超过 36 个字符")
    @TableField("\"PARENT_ID\"")
    private String parentId;

    /**
    * 组织机构描述
    */
    @ApiModelProperty(value = "组织机构描述", required = false)
    @Length(max = 42, message = "组织机构描述不能超过 42 个字符")
    @TableField("\"MEMO\"")
    private String memo;

    /**
    * 组织形态
    */
    @ApiModelProperty(value = "组织形态", required = true)
     @NotEmpty(message = "组织形态不能为空")
    @TableField("\"STATUS\"")
    private String status;

    /**
    * 省
    */
    @ApiModelProperty(value = "省", required = false)
    // @NotEmpty(message = "省不能为空")
    // @Length(max = 72, message = "省不能超过 72 个字符")
    @TableField("\"PROVINCE\"")
    private String province;

    /**
    * 市
    */
    @ApiModelProperty(value = "市", required = false)
    // @NotEmpty(message = "市不能为空")
    // @Length(max = 72, message = "市不能超过 72 个字符")
    @TableField("\"CITY\"")
    private String city;

    /**
    * 区县
    */
    @ApiModelProperty(value = "区县", required = false)
    // @NotEmpty(message = "区县不能为空")
    // @Length(max = 72, message = "区县不能超过 72 个字符")
    @TableField("\"DISTRICT\"")
    private String district;

    /**
    * 乡镇
    */
    @ApiModelProperty(value = "乡镇", required = false)
     @Length(max = 24, message = "乡镇不能超过 24 个字符")
    @TableField("\"TOWN\"")
    private String town;

    /**
    * 组织排序
    */
    @ApiModelProperty(value = "组织排序", required = true)
    @NotNull(message = "组织排序不能为空")
    @Max(value = 999, message = "组织排序不能超过 999")
    @Min(value = 0, message = "组织排序不能小于 0")
    @TableField("\"ORDER_NO\"")
    private Integer orderNo;

    /**
    * 详细地址
    */
    @ApiModelProperty(value = "详细地址", required = false)
    @Length(max = 128, message = "详细地址不能超过 128 个字符")
    @TableField("\"ADDR\"")
    private String addr;


    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除", required = false)
    @TableField(value = "\"IS_DELETE\"", fill = FieldFill.INSERT)
    @TableLogic  //逻辑删除注解
    @JsonIgnore  //忽略
    private Integer isDelete;

    /**
     * 创建用户
     */
    @ApiModelProperty(value = "创建用户", required = false)
    @TableField(value = "\"CREATE_USER\"", fill = FieldFill.INSERT)
    private String createUser;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", required = false)
    @TableField(value = "\"CREATE_DATE\"", fill = FieldFill.INSERT)
    private Date createDate;

    /**
     * 编辑用户
     */
    @ApiModelProperty(value = "编辑用户", required = false)
    @TableField(value = "\"UPDATE_USER\"", fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    /**
     * 编辑时间
     */
    @ApiModelProperty(value = "编辑时间", required = false)
    @TableField(value = "\"UPDATE_DATE\"", fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;
}
